import request from '@/utils/request'

// 获取购物车
export function memberCarItems(data) {
    return request({
        url: '/front/carItem/memberCarItems',
        method: 'POST',
        data,
        isLoading: false
    })
}

// 加入购物车
export function addProduct(data) {
    return request({
        url: '/front/carItem/addProduct',
        method: 'POST',
        data,
        isLoading: false
    })
}

// 删除购物车
export function cartDelete(data) {
    return request({
        url: '/front/carItem/delete',
        method: 'POST',
        data
    })
}

export function cartDeleteByProduct(data) {
    return request({
        url: '/front/carItem/deleteProduct/'+data,
        method: 'GET',
    })
}



// 立即购买确认订单
export function buyNowConfirmOrder(data) {
    return request({
        url: '/front/order/buyNowConfirmOrder',
        method: 'POST',
        data
    })
}

// 立即购买生成订单
export function buyNowCreateOrder(data) {
    return request({
        url: '/front/order/buyNowCreateOrder',
        method: 'POST',
        data
    })
}

// 购物车确认订单
export function carConfirmOrder(data) {
    return request({
        url: '/front/order/carConfirmOrder',
        method: 'POST',
        data
    })
}

// 购物车生成订单
export function carCreateOrder(data) {
    return request({
        url: '/front/order/carCreateOrder',
        method: 'POST',
        data
    })
}

// 订单列表
export function fontPage(data) {
    return request({
        url: '/front/order/fontPage',
        method: 'GET',
        data
    })
}


// 订单详情
export function frontDetail(data) {
    return request({
        url: '/front/order/frontDetail',
        method: 'GET',
        data
    })
}

// 取消订单
export function cancelOrder(data) {
    return request({
        url: '/front/order/cancelOrder',
        method: 'POST',
        data
    })
}

// 确认收货
export function confirmGet(data) {
    return request({
        url: '/front/order/confirmGet',
        method: 'POST',
        data
    })
}

// 去付款
export function confirmPay(data) {
    return request({
        url: '/front/order/confirmPay',
        method: 'POST',
        data
    })
}

// 删除订单
export function deleteOrder(data) {
    return request({
        url: '/front/order/deleteOrder',
        method: 'POST',
        data
    })
}

// 发起退款/退货
export function doRefund(data) {
    return request({
        url: '/front/orderRefund/doRefund',
        method: 'POST',
        data
    })
}

// 撤销退款/退货
export function cancelRefund(data) {
    return request({
        url: '/front/orderRefund/cancelRefund',
        method: 'POST',
        data
    })
}

// 用户提交物流信息
export function memberSubmitExpress(data) {
    return request({
        url: '/front/orderRefund/memberSubmitExpress',
        method: 'POST',
        data
    })
}

// 根据订单编号查询物流信息
export function viewLogistics(data) {
    return request({
        url: '/front/order/viewLogistics',
        method: 'GET',
        data
    })
}
